<!DOCTYPE html>
<html>
<head>
	<title>sign</title>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link href="../../css/bootstrap.min.css" rel="stylesheet">
	<!-- <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> -->
	<link rel="stylesheet" type="text/css" href="../../css/sign.css">
</head>
<body>
	<div class="login-box">
		<div class="login-box-content">
			<div class="login-logo">
				<p>餐饮营销支持系统</p>
			</div>
			<div class="login-box-body">
				<p class="login-box-msg"><b>用户登录</b>
				</p>
				<form id="loginForm" action="j_security_check" method="post" class="form-horizontal">
					<div class="form-group">
						<div class="col-sm-12">
							<input type="text" id="phone" name="phone" placeholder="手机号" maxlength="100" class="form-control" />
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-12">
							<input type="password" id="j_password" name="password" placeholder="密码" maxlength="80" class="form-control" />
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-12">
							<button class="btn btn-success btn-block" id="btn-in" type="button">登 录</button>  
						</div>
					</div>
				</form>
			</div>
		</div>	
	</div>
	<script type="text/javascript" src="../../js/tools/md5.js"></script>
	<script src="../../js/Jquary/jquery-3.2.1.min.js"></script>
	<script src="../../js/Jquary/jquery.easyui.min.js"></script>
	<script src="../../js/bootstrap.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#btn-in").click(function(){
				var phone=$("*[name='phone']").val();
				var password=$("*[name='password']").val();
				$.ajax({
					type:"post",
					url:"/ldss/customers/login",
					async:false,
					data:{
						tel:phone,
						passwd:md5(password)
					},
					dataType:"json",
					success: function (data) {
						var data = data;
						if(data.success){
							if(data.flag==-1){
								var r=confirm("处理后该记录将会消失，是否处理？");
								if (r==true){
									window.location.href="/ldss/ldss/activeaccount";
								}
							}else{
								window.location.href="/ldss/ldss/myaccount";
							}
						}else{
							alert(data.message);
						}
					},
					error: function(){
						alert("请求出错");
					}
				})
			});
		})
	</script>
</body>
</html>